Conversation
a28d11f to
f046ae3
Compare
f046ae3 to
6431ca9
Compare
relwell
approved these changes
Feb 17, 2026
|
|
||
| select { | ||
| case <-provisioningContext.Done(): | ||
| if executionErr != nil && !errors.As(executionErr, &exitErr) && !errors.Is(executionErr, context.Canceled) { |
Contributor
There was a problem hiding this comment.
It might be good to wrap this into a private function so that the behavior is a little more semantic
20f5f0c to
8676f77
Compare
Previously the provisioning and execution were bundled together in the same func. This leads to several issues: 1. When the execution fails, the provisioning tried to deploy a new VM, thinking the provisioning of the VM failed. 2. When the execution fails due to ssh connection, a new VM was either deployed or the running one was deleted, although it was running an actual active job. Now the provisioning retries until a VM and a runner are present. Then the execution is performed. The resources are cleaned if the execution completes. If there is an SSH error then the VM is not deleted and it is relied on the JobCompleted event to clean up the resources. This ensures active VMs are not deleted and the jobs are not lost. Finally, add more logging
fe88863 to
599417b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Previously the provisioning and execution were bundled together in the same func.
This leads to several issues:
Now the provisioning retries until a VM and a runner are present.
Then the execution is performed.
The resources are cleaned if the execution completes. If there is an SSH error then the VM is not deleted and it is relied on the JobCompleted event to clean up the resources.
This ensures active VMs are not deleted and the jobs are not lost.
Finally, add more logging
Testing
Case 1
Case 2
Case 3
Case 4